
#include	<string>

#include "TestLogLevel.h"

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>

using namespace std;

//CPPUNIT_TEST_SUITE_REGISTRATION( TestLogLevel );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TestLogLevel, "TestLogLevel" );

void	TestLogLevel::setUp (void) 
{
}	
	
void	TestLogLevel::tearDown (void)
{
}
	
void	TestLogLevel::testClear (void)
{
	CPPUNIT_ASSERT ( 1 > 0 );
}
	
void    TestLogLevel::testLogLevel(void)
{
    CPPUNIT_ASSERT( 1000 == tiny::LogLevel::getFatalLevel() );
    CPPUNIT_ASSERT( 2000 == tiny::LogLevel::getErrorLevel() );
    CPPUNIT_ASSERT( 3000 == tiny::LogLevel::getWarnLevel() );
    CPPUNIT_ASSERT( 4000 == tiny::LogLevel::getInfoLevel() );
    CPPUNIT_ASSERT( 5000 == tiny::LogLevel::getDebugLevel() );
    CPPUNIT_ASSERT( 6000 == tiny::LogLevel::getTraceLevel() );

    CPPUNIT_ASSERT( tiny::LogLevel::FATAL == tiny::LogLevel::getFatalLevel());
    CPPUNIT_ASSERT( tiny::LogLevel::ERROR == tiny::LogLevel::getErrorLevel());
    CPPUNIT_ASSERT( tiny::LogLevel::WARN == tiny::LogLevel::getWarnLevel());
    CPPUNIT_ASSERT( tiny::LogLevel::INFO == tiny::LogLevel::getInfoLevel());
    CPPUNIT_ASSERT( tiny::LogLevel::DEBUG == tiny::LogLevel::getDebugLevel());
    CPPUNIT_ASSERT( tiny::LogLevel::TRACE == tiny::LogLevel::getTraceLevel());
}

void    TestLogLevel::testLogLevelName(void)
{
    CPPUNIT_ASSERT( tiny::LogLevel::LEVEL_NAME_FATAL == tiny::LogLevel::getFatalLevelName() );
    CPPUNIT_ASSERT( tiny::LogLevel::LEVEL_NAME_ERROR == tiny::LogLevel::getErrorLevelName() );
    CPPUNIT_ASSERT( tiny::LogLevel::LEVEL_NAME_WARN == tiny::LogLevel::getWarnLevelName() );
    CPPUNIT_ASSERT( tiny::LogLevel::LEVEL_NAME_INFO == tiny::LogLevel::getInfoLevelName() );
    CPPUNIT_ASSERT( tiny::LogLevel::LEVEL_NAME_DEBUG == tiny::LogLevel::getDebugLevelName() );
    CPPUNIT_ASSERT( tiny::LogLevel::LEVEL_NAME_TRACE == tiny::LogLevel::getTraceLevelName() );
}

